$OpenBSD: patch-src_tcl_tclcmdmz_c,v 1.2 2017/05/09 13:01:42 espie Exp $
Index: src/tcl/tclcmdmz.c
--- src/tcl/tclcmdmz.c.orig
+++ src/tcl/tclcmdmz.c
@@ -162,7 +162,7 @@ Tcl_RegexpCmd(dummy, interp, argc, argv)
 	    }
 	} else {
 	    if (indices) {
-		sprintf(info, "%d %d", regexpPtr->startp[i] - string,
+		snprintf(info, 50, "%ld %ld", regexpPtr->startp[i] - string,
 			regexpPtr->endp[i] - string - 1);
 		result = Tcl_SetVar(interp, argPtr[i+2], info, 0);
 	    } else {
@@ -929,7 +929,7 @@ Tcl_StringCmd(dummy, interp, argc, argv)
 		    " length string\"", (char *) NULL);
 	    return TCL_ERROR;
 	}
-	sprintf(interp->result, "%d", strlen(argv[2]));
+	sprintf(interp->result, "%lu", strlen(argv[2]));
 	return TCL_OK;
     } else if ((c == 'm') && (strncmp(argv[1], "match", length) == 0)) {
 	if (argc != 4) {
